package com.wtwd.campus.vcom.dao;

import com.wtwd.campus.vcom.entity.VcomNotDisturb;
import com.wtwd.campus.vcom.entity.VcomRequestRecord;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;

/**
 * @Author: ldaoliang
 * @DateTime: 2022/1/6 10:27
 * @Description:
 */
@Mapper
public interface VcomDeviceInfoMapper {

    /**
     * 根据imei获取免打扰列表
     * @param imei
     * @return
     */
    VcomNotDisturb getVcomNotDisturbByImei(@Param("imei") String imei);

    /**
     * 添加威科姆免打扰
     * @param imei
     * @param data
     * @param commandNumber
     * @param status
     * @return
     */
    int addVcomNotDisturb(@Param("imei") String imei, @Param("data") String data,
                          @Param("commandNumber")String commandNumber,@Param("status")Integer status);

    /**
     *
     * @param imei
     * @param newData
     * @param commandNumber
     * @param status
     * @return
     */
    int updateVcomNotDisturb(@Param("imei") String imei, @Param("newData") String newData,
                             @Param("commandNumber") String commandNumber, @Param("status") Integer status);

    /**
     * 根据imei集合以及威科姆条件（deviceType customerId）筛选imei
     * @param imeiList
     * @param deviceType
     * @param customerId
     * @return
     */
    List<String> getImeiListByImeiListAndCondition(@Param("list")List<String> imeiList,@Param("deviceType")Integer deviceType,
                                                   @Param("customerId")Integer customerId);

    /**
     * 完成免打扰指令
     * @param imei
     * @return
     */
    int completeNotDisturb(String imei);

    /**
     * 处理失败的免打扰指令
     * @param imei
     * @return
     */
    int completeFailedNotDisturb(String imei);

    VcomRequestRecord getInstructionState(@Param("imei") String imei, @Param("requestId") String requestId);
}
